# import cv2   #版本为4.5.2
# import numpy as np
#
# cap0 = cv2.VideoCapture(1+ cv2.CAP_DSHOW)  # 视频流
# #cap0.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'))  #读取视频格式
# # 设置分辨率
# cap0.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
# cap0.set(cv2.CAP_PROP_FRAME_HEIGHT, 1024)
# while(cap0.isOpened()):
#     ret,frame=cap0.read()
#     if ret==True:
#         cv2.imshow("frame", frame)
#     pass
#     if cv2.waitKey(1000)&0xFF==ord("q"):
#         break
#     pass
# pass
# cap0.release()
# cv2.destroyAllWindows()


import scipy.io as scio

dataFile = r'C:\Users\14197\Desktop\书阅\2141204_Xinlei_Huang_2\data_for_eignfaces.mat'
data = scio.loadmat(dataFile)
eignfaces_blk = data['eignfaces_blk']
employees_DB = data['employees_DB']
import cv2
for i in range(100):
    cv2.imshow('face',eignfaces_blk[:,:,i])
    cv2.waitKey(100)
cv2.destroyAllWindows()